package io.renren.service.impl;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


import io.renren.dao.CourseteacherDao;
import io.renren.entity.CourseteacherEntity;
import io.renren.service.CourseteacherService;

import java.util.List;


@Service("courseteacherService")
public class CourseteacherServiceImpl extends ServiceImpl<CourseteacherDao, CourseteacherEntity> implements CourseteacherService {
    @Override
    public void addTeacherAnswer(Integer courseid, Integer userid, String answer){
        baseMapper.addTeacherAnswer(courseid,userid,answer);
    }

    @Override
    public List<CourseteacherEntity> getCourseTeacher(@Param("userid")Integer userid){
        List<CourseteacherEntity> list = baseMapper.getCourseTeacher(userid);
        return list;
    }

    @Override
    public CourseteacherEntity getCourseTeacherByUserIdAndCourseid(Integer courseid, Integer userid){
        CourseteacherEntity entity = baseMapper.getCourseTeacherByUserIdAndCourseid(courseid,userid);
        return entity;
    }
}
